<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
<button>点击触发</button>

<script>


 let name = "王麻子"
let person={age:18}
Object.defineProperty(person,"name",{
    // value:"王麻子", 
    configurable:true,
    // writable:true,
    get(){
        return name
    },
    set(value){
        name =value;
    }
})

console.log(person);
</script>
</body>
</html>